﻿using Epam.BusinessLogic;
using Epam.PeopleInterfaces;
using Epam.PeopleRepository;
using Microsoft.Practices.Unity;



namespace PeopleListTask
{
    public static class DependencyManager
    {
        public static IUnityContainer Container { get; set; }

        public static void Init()
        {
            Container=new UnityContainer();
            Container.RegisterInstance<IPeopleRepository>(new PeopleSqlRepository());
            Container.RegisterInstance<INewsRepository>(new NewsSqlRepository());
            Container.RegisterType<IFilterAlgoritm,Algoritms>();
            Container.RegisterType<INewsSkipAlgoritm, Algoritms>();
            Container.RegisterType<IPeopleService,PeopleService>();
            Container.RegisterType<IJsonPeopleService, PeopleJsonService>();
            Container.RegisterType<INewsService,NewsService>();
            Container.RegisterType<INewsJsonService, NewsJsonService>();
            
        }
    }
}